package com.handpay.zztong.hp.permission;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author sxshi on 2017/4/12.
 *         email:emotiona_xiaoshi@126.com
 *         describe:Describe the function  of the current class
 */

public class PermissionRequestName {
    /**
     * 获取权限名称
     *
     * @param permissions
     * @return 返回权限对应的提示名称
     */
    public static String getPermissionNames(List<String> permissions) {
        StringBuilder stringBuilder = new StringBuilder("获取");
        Map<String, String> permissionNames = new HashMap<>();
        permissionNames.put("Manifest.permission.ACCESS_FINE_LOCATION", "定位");
        permissionNames.put("Manifest.permission.READ_PHONE_STATE", "手机状态");
        permissionNames.put("Manifest.permission.WRITE_EXTERNAL_STORAGE", "手机存储");
        permissionNames.put("Manifest.permission.CAMERA", "相机");
        permissionNames.put("Manifest.permission.RECORD_AUDIO", "麦克风");
        for (String permission : permissions) {
            stringBuilder.append(permissionNames.get(permission)).append("、");
        }
        stringBuilder.append("权限");
        return stringBuilder.toString();
    }
}
